#! /bin/sh
# build velocity profiles with unif2
WIDTH=420
HEIGHT=400
WIDTHOFF1=0
WIDTHOFF2=430
WIDTHOFF3=0
WIDTHOFF4=430
HEIGHTOFF1=50
HEIGHTOFF2=50
HEIGHTOFF3=500
HEIGHTOFF4=500

HEIGHTOFF5=275
WIDTHOFF5=860

outfile=template
n1=100
n2=100
d1=10
d2=10

# use unif2 to output test datafile
# $outfile is an ascii file that shows the type of input unif2 requires
unif2  tfile=$outfile 

# now create the uniformly sampled velocity profile
# for linear, mono, akima, spline interpolation schemes
j=1
for i in linear mono akima spline
do
	eval WOFF='$'WIDTHOFF$j
	eval HOFF='$'HEIGHTOFF$j
	unif2 <$outfile method=$i |
	xmovie  n1=$n1 n2=$n2 d1=$d1 d2=$d2 \
		title="$i Interpolation" \
		-geometry ${WIDTH}x${HEIGHT}+${WOFF}+${HOFF} &
	j=`expr $j + 1`
done


# different smooth background velocities
dvdx1=10 dvdx2=30 dvdx3=50 dvdx4=10 dvdx5=-30
dvdz1=20 dvdz2=20 dvdz3=60 dvdz4=40 dvdz5=10
v00=1000,200,4000,300,800
x0=1000,900,800,400,100
z0=200,300,600,800,900

unif2 < $outfile method=spline \
	dvdx=$dvdx1,$dvdx2,$dvdx3,$dvdx4,$dvdx5 \
	dvdz=$dvdz1,$dvdz2,$dvdz3,$dvdz4,$dvdz5 \
	x0=$x0 z0=$z0 |
	xmovie n1=$n1 n2=$n2 d1=$d1 d2=$d2 \
	title="Smooth background wavespeeds"\
	-geometry ${WIDTH}x${HEIGHT}+${WIDTHOFF5}+${HEIGHTOFF5} &

exit
